package com.orchidea.uml.model
{
    public class UmlEntityType
    {
        public static var CLASS : UmlEntityType                     = new UmlEntityType("class");
        public static var INTERFACE : UmlEntityType                 = new UmlEntityType("interface");

        private var _type : String;

        public function get type():String
        {
			return _type;
		}

        public static function fromString( typeString : String ) : UmlEntityType
        {
			var instance : UmlEntityType = UmlEntityType[typeString.toUpperCase()];

			if ( instance == null ) {
				throw new ArgumentError("String does not match an existing relation type: " + typeString);
			}

			return instance;
		}

        public function UmlEntityType(type:String)
        {
            _type = type;
        }
    }
}